package com.xingzhe.pengji.security.sql.common;

/**
 * @Title ： 三江学院 毕业设计
 * @Description ：
 * @author ：LuFengLiang
 * @Company: IT行者工作室
 * @Copyright: Copyright (c) 2012-2-24
 * @version ： 1.0
 */
public interface SqlKeyWord
{

    public enum Relationship
    {
        /**等于*/
        EQUAL(0, "="),
        /**大于*/
        MORE_THAN(1, ">"),
        /**小于*/
        LESS_THAN(-1, "<"),
        /**不等于*/
        NOT_EQUAL(3, "!="),
        /**大于等于*/
        MORE_THAN_OR_EQUAL(2, ">="),
        /**小于等于*/
        LESS_THAN_OR_EQUAL(-2, "<="),
        /**LIKE关键字*/
        LIKE(-3, "LIKE");

        int id;
        String value = null;

        public int getId()
        {
            return id;
        }

        public void setId(int id)
        {
            this.id = id;
        }

        public String getValue()
        {
            return value;
        }

        public void setValue(String value)
        {
            this.value = value;
        }

        Relationship(int id, String value)
        {
            this.id = id;
            this.value = value;
        }
    }

    public enum KeyWord
    {

        START(0, "*"),
        /**空格*/
        SPACE(0, " "),
        /**From*/
        FROM(0, "FROM"),
        /**Where*/
        WHERE(0, "WHERE"),
        /**And*/
        AND(0, "AND"),

        IN(0, "IN"),

        /**单引号*/
        SQM(0, "'"),
        /**左边括号*/
        LEFTBRACKETS(0, "("),
        /**右边括号*/
        RIGHTBRACKETS(0, ")"),
        /**逗号*/
        COMMA(0, ","),
        /**%*/
        PEERCENT(0, "%"),
        /**_*/
        UNDER_LINE(0, "_"),

        /**插入*/
        INSTRT_INTO(1, "INSERT INTO"), VALUES(1, "VALUES"),

        UPDATE(2, "UPDATE"), SET(2, "SET"),

        DELETE(3, "DELETE"),

        SELECT(4, "SELECT"),
        /**统计*/
        COUNT(4, "COUNT"),
        /**Order By*/
        ORDER_BY(4, "ORDER BY"), LIMIT(4, "LIMIT");

        int id;
        String value = null;

        public int getId()
        {
            return id;
        }

        public void setId(int id)
        {
            this.id = id;
        }

        public String getValue()
        {
            return value;
        }

        public void setValue(String value)
        {
            this.value = value;
        }

        KeyWord(int id, String value)
        {
            this.id = id;
            this.value = value;
        }
    }

}
